import config from '../config/config';
import request from '../utils/request';

let service = {};
//群接龙
service.groupgoodslist = (param, cb) => {
  param = param || {};
  let requestUrl = config.api.groupgoodslist;
  request({
    url: requestUrl,
    showLoading: true,
    data: param,
    method: 'GET',
    success: res => {
      cb(res);
    }
  });
}

//群接龙轮播
service.shufflingorder = (param, cb) => {
  param = param || {};
  let requestUrl = config.api.shufflingorder;
  request({
    url: requestUrl,
    // showLoading: true,
    data: param,
    method: 'GET',
    success: res => {
      cb(res);
    }
  });
}

//我的群接龙
service.solitaireorderlist = (param, cb) => {
  param = param || {};
  let requestUrl = config.api.solitaireorderlist;
  request({
    url: requestUrl,
    showLoading: true,
    data: param,
    method: 'GET',
    success: res => {
      cb(res);
    }
  });
}

//2.12.0买家今日热销商品
service.customerRecommend = (param, cb) => {
  param = param || {};
  let requestUrl = config.api.customerRecommend;
  request({
    url: requestUrl,
    showLoading: true,
    data: param,
    method: 'GET',
    success: res => {
      cb(res);
    }
  });
}

module.exports = service;